#include <time.h>
#include <stdio.h>
int main()
{
  time_t tNow =time(NULL);
  struct tm* ptm = localtime(&tNow);

  char szTmp[50] = {0};
  strftime(szTmp, 50,"%H:%M:%S", ptm);
  printf("%s\n",szTmp);
  printf("[%d-%d-%d][%d:%d:%d][%d]\n",
         ptm->tm_year + 1900,
         ptm->tm_mon + 1,
         ptm->tm_mday,
         ptm->tm_hour,
         ptm->tm_min,
         ptm->tm_sec,
         ptm->tm_wday);

  printf("sec of today = [%d]\n", 3600*ptm->tm_hour + 60*ptm->tm_min + ptm->tm_sec);
  return 0;
}
